var base = {

    /**
     *退出
     *
     */
    logout : function(){
        window.location.href="login.jsp";
        //清除cookie
    },

    init : function(){
        //加载用户名
        
        //右边侧面aside伸缩
        $('#slidebtn').click(function(){
                if($("#aside").hasClass("open")){
                    $("#aside").animate({width:"20px"}).removeClass("open");
                    $("#slidebtn > span").html("&lt;");
                }else{
                    $("#aside").animate({width:"233px"}).addClass("open");
                    $("#slidebtn > span").html("&gt;");
                }
        });
    },
};

$.extend({
    getUrlVars : function(){
        var href = decodeURIComponent(document.location.href);
        var vars = [], hash, hashes=[], start, end;
        start = href.indexOf('?')+1;
        end = href.indexOf('#') > 0 ? href.indexOf('#') : href.length;
        hashes = href.slice(start, end).split('&');

        for (var i = 0; i < hashes.length; i++) {
            hash = hashes[i].split('=');

            vars.push(hash[0]);
            vars[hash[0]] = hash[1];
        };

        return vars;
    },
    getUrlVar : function(name){
        return $.getUrlVars()[name];
    }
});
